import http from "@/api/axios";
import { BusinessType } from "@/api/moduleConfig";
export const getListApi = (data: WaterVerification.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/deposit/queryPage`,
    data
  });
};
export const getPageStaticApi = (data: DepositRegister.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/deposit/queryPageCount`,
    data
  });
};
// 导出付款流水EXCEL
export const downWaterExcelApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/deposit/downExcel`,
    data
  });
};
// 校验excel 数据
export const verifyExcelApi = (data: FormData) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/deposit/verifyExcel`,
    data,
    headers: {
      "Content-type": "multipart/form-data"
    }
  });
};
// 导入来款流水
export const importDepositApi = (data: { passDepositList: Array<Base.GeneraDataType>; failDepositList: Array<Base.GeneraDataType>; passDepositSummaryList: Array<Base.GeneraDataType> }) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/deposit/importDeposit`,
    data
  });
};
// 审核来款
export const auditDepositApi = (data: WaterVerification.AuditDepositParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/deposit/edit`,
    data
  });
};
// 删除来款
export const deleteDepositApi = (params: { id: string }) => {
  return http({
    method: "delete",
    url: `${BusinessType.finance}/biz/deposit/deleteById`,
    params
  });
};
// 获取来款删除日志
export const getDepositDeleteLogApi = (data: { pageNum: number; pageSize: number; beforePageNum: number }) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/deposit/queryDeleteRecord`,
    data
  });
};
// 获取账户 级联 选择
export const getAllAccountTreeApi = () => {
  return http({
    method: "get",
    url: `${BusinessType.finance}/biz/deposit/getDeptAccount`
  });
};
// 获取登记人
export const getRegistrantTreeApi = () => {
  return http({
    method: "get",
    url: `${BusinessType.finance}/biz/deposit/getRegistrant`
  });
};
// 根据ID 获取待审核流水
export const getDepositByCustomerIdApi = (data: { id: string; selectNext?: boolean }) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/deposit/queryById`,
    data
  });
};
// 反审核
export const reverseApprovalApi = (data: Array<string>) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/deposit/reverseApproval`,
    data
  });
};
// 反核销流水
export const reverseChargeOffDepositApi = (data: Array<string>) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/deposit/reverseChargeOffDeposit`,
    data
  });
};

// 导出
export const depositExceltApi = (data: Array<string>) => {
  return http({
    method: "post",
    url: `export/biz/exportExcel/depositExcel`,
    data
  });
};

// 导出全部流水
export const downAllDataApi = () => {
  return http({
    method: "post",
    url: `export/biz/exportExcel/allDepositExcel`
  });
};

// 修改流水备注
export const updateRemarkApi = (data: { idList: Array<string>; remark: string }) => {
  return http({
    method: "post",
    url: `fin/biz/deposit/updateRemark`,
    data
  });
};

// 查询经营单核和收款账户接口增加客户过滤
export const getDeptAccountApi = (data: string) => {
  return http({
    method: "get",
    url: `base/biz/deposit/getDeptAccount?customerId=${data}`
  });
};
